<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>创建对象</title>
</head>
<body>

</body>
<script type="text/javascript">
    /**
     * 创建对象的两种方式:
     * 1. var.obj = new Object();
     * 通过obj.属性设置属性并为属性赋值
     * 2. var obj = {key:value,key:value....}
     * @type {Object}
     */
    var stuObj = new Object();
    stuObj.id = '1001';
    stuObj.name = "张三";
    stuObj.age = 23;
    console.log(stuObj);
    var userObj = {
        id:1,
        username:"admin",
        password:"123456"
    };
    userObj.id = 2222;
    console.log(userObj.id);
</script>
</html>